export default function MapLoader1 () {   // <-- 原作者这里使用的是module.exports
    return new Promise((resolve, reject) => {
        if (window.AMaps) {
            resolve(window.AMaps)
        } else {
            var script = document.createElement('script')
            script.type = 'text/javascript'
            script.async = true
            script.src = 'https://webapi.amap.com/maps?v=1.4.15&callback=initAMaps&key=66f8972b3e70348d2ed3aaf38e903575&plugin=AMap.DistrictSearch'
            script.onerror = reject
            document.head.appendChild(script)
        }
        window.initAMaps = () => {
            resolve(window.AMaps)
        }
    })
}



